package cn.edu.ncut.cs.springboot.petmanagementsystem.service;

import cn.edu.ncut.cs.springboot.petmanagementsystem.pojo.Order;
import com.baomidou.mybatisplus.core.metadata.IPage;

import java.util.List;

public interface OrderService {
    /**
     * 提交订单并生成支付信息
     */
    Order createOrder(Long userId, List<Long> cartIds, String shippingAddress, String receiverName, String receiverPhone);

    /**
     * 查询当前用户的订单记录
     */
    IPage<Order> getOrderList(Long userId, Integer pageNum, Integer pageSize);

    /**
     * 查看订单详细信息
     */
    Order getOrderDetail(Long orderId, Long userId);

    /**
     * 更新订单状态
     */
    boolean updateOrderStatus(Long orderId, Integer status);

    /**
     * 取消订单
     */
    boolean cancelOrder(Long orderId, Long userId);

    /**
     * 确认收货
     */
    boolean confirmOrder(Long orderId, Long userId);

    /**
     * 订单支付
     */
    boolean payOrder(Long orderId, Long userId, Integer paymentMethod);

    /**
     * 查询订单状态
     */
    Integer getOrderStatus(Long orderId, Long userId);

    /**
     * 申请退款
     */
    boolean refundOrder(Long orderId, Long userId, String reason);
}
